package com.ruoyi.web;

import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.web.gj.domain.WarningInfo;
import com.ruoyi.web.gj.mapper.WarningInfoMapper;
import com.ruoyi.web.gj.service.IWarningInfoService;
import com.ruoyi.web.hb.mapper.ChannelBuoyMapper;
import com.ruoyi.web.hb.service.IChannelBuoyService;
import com.ruoyi.web.xj.domain.Camera;
import com.ruoyi.web.xj.mapper.CameraMapper;
import com.ruoyi.web.xj.service.ICameraService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;

/**
 * 告警数据Controller
 *
 * @author ruoyi
 * @date 2025-09-19
 */
@RestController
@RequestMapping("/system/main")
public class GgController
{
    @Resource
    private WarningInfoMapper warningInfoMapper;
    @Resource
    private ChannelBuoyMapper channelBuoyMapper;
    @Resource
    private CameraMapper cameraMapper;
    /**
     * 查询告警数据列表
     */
    @GetMapping("/list")
    public Map list()
    {
        Map map = new HashMap();
        WarningInfo warningInfo = new WarningInfo();
        List<WarningInfo> list = warningInfoMapper.selectWarningInfoList(warningInfo);
        map.put("gjxx",list);
        List<Map> map1 = channelBuoyMapper.selectChannelBuoyCount();
        map.put("sssj",map1);
        Camera camera1 = new Camera();
        //灯
        camera1.setAddressFlag("1");
        List<Camera> cameras = cameraMapper.selectCameraList(camera1);
        map.put("hbdhj",cameras);
        //环境安全
        Camera camera2 = new Camera();
        camera2.setAddressFlag("0");
        List<Camera> cameras2 = cameraMapper.selectCameraList(camera2);
        map.put("hjaq",cameras2);
        return map;
    }


}

